
    // app.use(async (ctx,next)=>{
    //     if(ctx.path =="/login" || ctx.path=="/doLogin"){
    //         await next();
    //     }else{
    //         /* 如果不走登录模块 */
    //         if(ctx.cookies.get("login")){
    //             await next();
    //         }else{
    //             await ctx.redirect("/login")
    //         }
    //     }
    // })

    const render = require('koa-art-template');
    const path = require("path");
    const requireDir = require("require-directory");
    const Router = require("koa-router")
    function initProject(app){
        requireDir(module,"../routers",{visit:loadRoutes})
        render(app, {
            root: path.join(process.cwd(), 'pages'),
            extname: '.html',
            debug: process.env.NODE_ENV !== 'production'
        });
        function loadRoutes(obj){
            console.log(obj instanceof Router);
            if(obj instanceof Router){
                app.use(obj.routes());
            }
        }
    }
    module.exports = initProject;